package logger.sd.client;

import static org.junit.Assert.*;

import org.apache.log4j.Level;
import org.junit.*;

/**
 * The class <code>ClientLoggerTest</code> contains tests for the class
 * <code>{@link ClientLogger}</code>.
 * 
 * @author Wendell
 */
public class ClientLoggerTest extends ClientTest {

	/**
	 * Run the ClientLogger getInstance() method test.
	 * 
	 * @throws Exception
	 */
	@Test
	public void testGetInstance() throws Exception {

		System.out.println("Testando ClientLogger.getInstance()");

		ClientLogger result = ClientLogger.getInstance();
		assertNotNull(result);
	}

	/**
	 * Run the void log(Level,String) method test.
	 * 
	 * @throws Exception
	 */
	@Test
	public void testLog() throws Exception {

		System.out.println("Testando ClientLogger.log(Level, String)");
		ClientLogger fixture = ClientLogger.getInstance();
		fixture.connect(host, port);
		fixture.setLevel(Level.toLevel(1));
		String message = "message";

		fixture.log(Level.toLevel(1), message);
	}

	/**
	 * Run the void setLevel(Level) method test.
	 * 
	 * @throws Exception
	 */
	@Test
	public void testSetLevel() throws Exception {
		System.out.println("Testando ClientLogger.setLevel(Level)");
		ClientLogger fixture = ClientLogger.getInstance();
		fixture.setLevel(Level.toLevel(1));
		Level level = Level.toLevel(1);

		fixture.setLevel(level);
	}

	/**
	 * Run the void end() method test.
	 * 
	 * @throws Exception
	 */
	@Test
	public void testEnd() throws Exception {
		System.out.println("Testando ClientLogger.end()");
		ClientLogger fixture = ClientLogger.getInstance();
		fixture.setLevel(Level.toLevel(1));

		fixture.end();
	}

	/**
	 * Launch the test.
	 * 
	 * @param args
	 *            the command line arguments
	 * 
	 * @generatedBy CodePro at 12/10/10 10:37
	 */
	public static void main(String[] args) {

		new org.junit.runner.JUnitCore().run(ClientLoggerTest.class);
	}

}